import http from "@/utils/request";

function noticeListRequest(name, per, page){
  return http({
    method:'get',
    url:'/api/v1/admin/notice',
    params:{name,per,page}
  })
}


function noticeAddRequest(name, desc, coverImage, conten){
  return http({
    method:'post',
    url:'/api/v1/admin/notice',
    data:{name, desc, coverImage, conten}
  })
}

function noticeDeleteRequest(id){
  return http({
    method:'delete',
    url:`/api/v1/admin/notice/${id}`,
    params:{id}
  })
}

function noticeUpdateRequest(id,name, desc, coverImage, conten){
  return http({
    method:'put',
    url:`/api/v1/admin/notice/${id}`,
    data:{id,name, desc, coverImage, conten}
  })
}

export {noticeListRequest,noticeAddRequest,noticeDeleteRequest,noticeUpdateRequest}